<?php
include "config.php";
if (isset($_GET["uname"])) {
    //1.接受到 浏览器往服务器传递的参数
    $UNAME = $_GET["uname"];
    //2. 创建数据库的链接对象
//    $host = "127.0.0.1";
//    $name = "root";
//    $pwd = "";
//    $db = "usermessage";
//    $port = "3306";
//    $conn = new mysqli($host, $name, $pwd, $db, $port);
//    //3. 设置链接的字符集 php=== mysql
//    mysqli_query($conn, "set names utf8");
    //4. 准备sql语句
    $sql = "SELECT*FROM user2 WHERE uname='" . $UNAME . "'";
    //5.执行sql语句
    $reuslt = $conn->query($sql);
    //6.判断结果
    if ($reuslt->num_rows>=1){
        print_r( "false");
    }else{
        print_r( "true");
    }

    //7.关闭链接
    $conn->close();


}

